package com.itheima.TestDemo;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        //1 2 3 4 5 6 7 8 9 10 11 12
        System.out.println("请输入一个整数");
        int a=new Scanner(System.in).nextInt();
        System.out.println(add(a));
    }
    public static int add(int a){

       return  (a>1)?add(a-1)+a:a;


    }
}
